import { CHANNEL_GET, CHANNEL_SETACTIVEID } from '../actionTypes'
const initState = {
  activeId: 0, // 当前选中的 频道id
  channels: [] // 所有的频道数据
}
export default function channel (state = initState, action) {
  console.log(action)
  switch (action.type) {
    case CHANNEL_GET:
      return { ...state, channels: action.payload }
    // 高亮
    case CHANNEL_SETACTIVEID:
      return { ...state, activeId: action.payload }
    default:
      return state
  }
}
